<!DOCTYPE html>
<html lang="en">
  <head>
    <title>SynchronizedPeripheral Class Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset='utf-8'>
    <script src="../js/jquery.min.js" defer></script>
    <script src="../js/jazzy.js" defer></script>
    
  </head>
  <body>
    <a name="//apple_ref/swift/Class/SynchronizedPeripheral" class="dashAnchor"></a>
    <a title="SynchronizedPeripheral Class Reference"></a>
    <header>
      <div class="content-wrapper">
        <p><a href="../index.html">Bluejay Docs</a> (100% documented)</p>
        <p class="header-right"><a href="https://github.com/steamclock/bluejay"><img src="../img/gh.png"/>View on GitHub</a></p>
      </div>
    </header>
    <div class="content-wrapper">
      <p id="breadcrumbs">
        <a href="../index.html">Bluejay Reference</a>
        <img id="carat" src="../img/carat.png" />
        SynchronizedPeripheral Class Reference
      </p>
    </div>
    <div class="content-wrapper">
      <nav class="sidebar">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a href="../Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Classes/Bluejay.html">Bluejay</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/SynchronizedPeripheral.html">SynchronizedPeripheral</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Enums.html">Enumerations</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Enums/AutoReconnectMode.html">AutoReconnectMode</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/BackgroundRestoreCompletion.html">BackgroundRestoreCompletion</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/BackgroundRestoreMode.html">BackgroundRestoreMode</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/BluejayError.html">BluejayError</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/ConnectionResult.html">ConnectionResult</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/DisconnectionResult.html">DisconnectionResult</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/ListenAction.html">ListenAction</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/ListenRestoreAction.html">ListenRestoreAction</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/MultipleListenOption.html">MultipleListenOption</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/ReadResult.html">ReadResult</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/RunResult.html">RunResult</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/ScanAction.html">ScanAction</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/StartMode.html">StartMode</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/Timeout.html">Timeout</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/WriteResult.html">WriteResult</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Extensions/BinaryInteger.html">BinaryInteger</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/CBManagerState.html">CBManagerState</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/CBPeripheral.html">CBPeripheral</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/CBPeripheralState.html">CBPeripheralState</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/CBService.html">CBService</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/Data.html">Data</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/Peripheral.html">Peripheral</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/String.html">String</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Protocols/BackgroundRestorer.html">BackgroundRestorer</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/ConnectionObserver.html">ConnectionObserver</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/DisconnectHandler.html">DisconnectHandler</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/ListenRestorer.html">ListenRestorer</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/LogObserver.html">LogObserver</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/RSSIObserver.html">RSSIObserver</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/Receivable.html">Receivable</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/Sendable.html">Sendable</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/ServiceObserver.html">ServiceObserver</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Structs.html">Structures</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Structs/BackgroundRestoreConfig.html">BackgroundRestoreConfig</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/DataPadding.html">DataPadding</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/PeripheralIdentifier.html">PeripheralIdentifier</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/ScanDiscovery.html">ScanDiscovery</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/ServiceIdentifier.html">ServiceIdentifier</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/StartOptions.html">StartOptions</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/WarningOptions.html">WarningOptions</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Typealiases.html">Type Aliases</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Typealiases.html#/s:7Bluejay13LaunchOptionsa">LaunchOptions</a>
              </li>
              <li class="nav-group-task">
                <a href="../Typealiases.html#/s:7Bluejay14ListenCallbacka">ListenCallback</a>
              </li>
              <li class="nav-group-task">
                <a href="../Typealiases.html#/s:7Bluejay17RestoreIdentifiera">RestoreIdentifier</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">
        <section>
          <section class="section">
            <h1>SynchronizedPeripheral</h1>
              <div class="declaration">
                <div class="language">
                  <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">SynchronizedPeripheral</span></code></pre>

                </div>
              </div>
            <p>A synchronous interface to the Bluetooth peripheral, intended to be used inside the backgroundTask block of <code>run(backgroundTask:completionOnMainThread:)</code> to perform multi-part operations without the need for a complicated callback or promise setup.</p>

          </section>
          <section class="section task-group-section">
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Actions"></a>
                <a name="//apple_ref/swift/Section/Actions" class="dashAnchor"></a>
                <a href="#/Actions">
                  <h3 class="section-name">Actions</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay22SynchronizedPeripheralC4read4fromxAA24CharacteristicIdentifierV_tKAA10ReceivableRzlF"></a>
                    <a name="//apple_ref/swift/Method/read(from:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay22SynchronizedPeripheralC4read4fromxAA24CharacteristicIdentifierV_tKAA10ReceivableRzlF">read(from:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Read a value from the specified characteristic synchronously.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="n">read</span><span class="o">&lt;</span><span class="kt">R</span><span class="o">&gt;</span><span class="p">(</span><span class="n">from</span> <span class="nv">characteristicIdentifier</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">R</span> <span class="k">where</span> <span class="kt">R</span> <span class="p">:</span> <span class="kt"><a href="../Protocols/Receivable.html">Receivable</a></span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay22SynchronizedPeripheralC5write2to5value4typeyAA24CharacteristicIdentifierV_xSo25CBCharacteristicWriteTypeVtKAA8SendableRzlF"></a>
                    <a name="//apple_ref/swift/Method/write(to:value:type:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay22SynchronizedPeripheralC5write2to5value4typeyAA24CharacteristicIdentifierV_xSo25CBCharacteristicWriteTypeVtKAA8SendableRzlF">write(to:value:type:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Write a value from the specified characteristic synchronously.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="n">write</span><span class="o">&lt;</span><span class="kt">S</span><span class="p">:</span> <span class="kt"><a href="../Protocols/Sendable.html">Sendable</a></span><span class="o">&gt;</span><span class="p">(</span><span class="n">to</span> <span class="nv">characteristicIdentifier</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">,</span> <span class="nv">value</span><span class="p">:</span> <span class="kt">S</span><span class="p">,</span> <span class="nv">type</span><span class="p">:</span> <span class="kt">CBCharacteristicWriteType</span> <span class="o">=</span> <span class="o">.</span><span class="n">withResponse</span><span class="p">)</span> <span class="k">throws</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay22SynchronizedPeripheralC12writeAndRead0D2To5value4type8readFromxAA24CharacteristicIdentifierV_q_So25CBCharacteristicWriteTypeVAJtKAA10ReceivableRzAA8SendableR_r0_lF"></a>
                    <a name="//apple_ref/swift/Method/writeAndRead(writeTo:value:type:readFrom:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay22SynchronizedPeripheralC12writeAndRead0D2To5value4type8readFromxAA24CharacteristicIdentifierV_q_So25CBCharacteristicWriteTypeVAJtKAA10ReceivableRzAA8SendableR_r0_lF">writeAndRead(writeTo:value:type:readFrom:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Write to one characterestic then reading a value from another.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="n">writeAndRead</span><span class="o">&lt;</span><span class="kt">R</span><span class="p">:</span> <span class="kt"><a href="../Protocols/Receivable.html">Receivable</a></span><span class="p">,</span> <span class="kt">S</span><span class="p">:</span> <span class="kt"><a href="../Protocols/Sendable.html">Sendable</a></span><span class="o">&gt;</span> <span class="p">(</span>
    <span class="nv">writeTo</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">,</span>
    <span class="nv">value</span><span class="p">:</span> <span class="kt">S</span><span class="p">,</span>
    <span class="nv">type</span><span class="p">:</span> <span class="kt">CBCharacteristicWriteType</span> <span class="o">=</span> <span class="o">.</span><span class="n">withResponse</span><span class="p">,</span>
    <span class="nv">readFrom</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">R</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay22SynchronizedPeripheralC6listen2to7timeout10completionyAA24CharacteristicIdentifierV_AA7TimeoutOAA12ListenActionOxctKAA10ReceivableRzlF"></a>
                    <a name="//apple_ref/swift/Method/listen(to:timeout:completion:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay22SynchronizedPeripheralC6listen2to7timeout10completionyAA24CharacteristicIdentifierV_AA7TimeoutOAA12ListenActionOxctKAA10ReceivableRzlF">listen(to:timeout:completion:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Listen for changes on a specified characterstic synchronously.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="n">listen</span><span class="o">&lt;</span><span class="kt">R</span><span class="p">:</span> <span class="kt"><a href="../Protocols/Receivable.html">Receivable</a></span><span class="o">&gt;</span><span class="p">(</span> <span class="c1">// swiftlint:disable:this cyclomatic_complexity</span>
    <span class="n">to</span> <span class="nv">characteristicIdentifier</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">,</span>
    <span class="nv">timeout</span><span class="p">:</span> <span class="kt"><a href="../Enums/Timeout.html">Timeout</a></span> <span class="o">=</span> <span class="o">.</span><span class="k">none</span><span class="p">,</span>
    <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">R</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Enums/ListenAction.html">ListenAction</a></span><span class="p">)</span> <span class="k">throws</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay22SynchronizedPeripheralC9endListen2to5error10completionyAA24CharacteristicIdentifierV_s5Error_pSgyAA11WriteResultOcSgtKF"></a>
                    <a name="//apple_ref/swift/Method/endListen(to:error:completion:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay22SynchronizedPeripheralC9endListen2to5error10completionyAA24CharacteristicIdentifierV_s5Error_pSgyAA11WriteResultOcSgtKF">endListen(to:error:completion:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Stop listening to a characteristic synchronously.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">endListen</span><span class="p">(</span><span class="n">to</span> <span class="nv">characteristicIdentifier</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">,</span> <span class="nv">error</span><span class="p">:</span> <span class="kt">Error</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="p">((</span><span class="kt"><a href="../Enums/WriteResult.html">WriteResult</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span> <span class="k">throws</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay22SynchronizedPeripheralC11flushListen2to14nonZeroTimeout10completionyAA24CharacteristicIdentifierV_AA0I0OyyctKF"></a>
                    <a name="//apple_ref/swift/Method/flushListen(to:nonZeroTimeout:completion:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay22SynchronizedPeripheralC11flushListen2to14nonZeroTimeout10completionyAA24CharacteristicIdentifierV_AA0I0OyyctKF">flushListen(to:nonZeroTimeout:completion:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Flush a listen to a characteristic by receiving and discarding values for the specified duration.</p>

<p><strong>Warning</strong> Timeout defaults to 3 seconds. Specifying no timeout or a timeout with zero second will result in a fatal error.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">flushListen</span><span class="p">(</span><span class="n">to</span> <span class="nv">characteristicIdentifier</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">,</span> <span class="nv">nonZeroTimeout</span><span class="p">:</span> <span class="kt"><a href="../Enums/Timeout.html">Timeout</a></span> <span class="o">=</span> <span class="o">.</span><span class="nf">seconds</span><span class="p">(</span><span class="mi">3</span><span class="p">),</span> <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span> <span class="k">throws</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>characteristicIdentifier</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The characteristic to flush.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>nonZeroTimeout</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>How long to wait for incoming data.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>completion</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Block to call when the flush is complete.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay22SynchronizedPeripheralC14writeAndListen0D2To5value4type06listenG016timeoutInSeconds10completionyAA24CharacteristicIdentifierV_xSo25CBCharacteristicWriteTypeVALSiAA0F6ActionOq_ctKAA8SendableRzAA10ReceivableR_r0_lF"></a>
                    <a name="//apple_ref/swift/Method/writeAndListen(writeTo:value:type:listenTo:timeoutInSeconds:completion:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay22SynchronizedPeripheralC14writeAndListen0D2To5value4type06listenG016timeoutInSeconds10completionyAA24CharacteristicIdentifierV_xSo25CBCharacteristicWriteTypeVALSiAA0F6ActionOq_ctKAA8SendableRzAA10ReceivableR_r0_lF">writeAndListen(writeTo:value:type:listenTo:timeoutInSeconds:completion:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Handle a compound operation consisting of writing on one characterstic followed by listening on another for some streamed data.</p>

<p>Conceptually very similar to just calling write, then listen, except that the listen is set up before the write is issued, so that there should be no risks of data loss due to missed notifications, which there would be with calling them seperatly.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="n">writeAndListen</span><span class="o">&lt;</span><span class="kt">S</span><span class="p">:</span> <span class="kt"><a href="../Protocols/Sendable.html">Sendable</a></span><span class="p">,</span> <span class="kt">R</span><span class="p">:</span> <span class="kt"><a href="../Protocols/Receivable.html">Receivable</a></span><span class="o">&gt;</span><span class="p">(</span> <span class="c1">// swiftlint:disable:this cyclomatic_complexity</span>
    <span class="n">writeTo</span> <span class="nv">charToWriteTo</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">,</span>
    <span class="nv">value</span><span class="p">:</span> <span class="kt">S</span><span class="p">,</span>
    <span class="nv">type</span><span class="p">:</span> <span class="kt">CBCharacteristicWriteType</span> <span class="o">=</span> <span class="o">.</span><span class="n">withResponse</span><span class="p">,</span>
    <span class="n">listenTo</span> <span class="nv">charToListenTo</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">,</span>
    <span class="nv">timeoutInSeconds</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span>
    <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">R</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Enums/ListenAction.html">ListenAction</a></span><span class="p">)</span> <span class="k">throws</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay22SynchronizedPeripheralC16writeAndAssemble0D2To5value06listenG014expectedLength16timeoutInSeconds10completionyAA24CharacteristicIdentifierV_xALS2iAA12ListenActionOq_ctKAA8SendableRzAA10ReceivableR_r0_lF"></a>
                    <a name="//apple_ref/swift/Method/writeAndAssemble(writeTo:value:listenTo:expectedLength:timeoutInSeconds:completion:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay22SynchronizedPeripheralC16writeAndAssemble0D2To5value06listenG014expectedLength16timeoutInSeconds10completionyAA24CharacteristicIdentifierV_xALS2iAA12ListenActionOq_ctKAA8SendableRzAA10ReceivableR_r0_lF">writeAndAssemble(writeTo:value:listenTo:expectedLength:timeoutInSeconds:completion:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Similar to <code>writeAndListen</code>, but use this if you don&rsquo;t know or don&rsquo;t have control over how many packets will be sent to you. You still need to know the total size of the data you&rsquo;re receiving.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="n">writeAndAssemble</span><span class="o">&lt;</span><span class="kt">S</span><span class="p">:</span> <span class="kt"><a href="../Protocols/Sendable.html">Sendable</a></span><span class="p">,</span> <span class="kt">R</span><span class="p">:</span> <span class="kt"><a href="../Protocols/Receivable.html">Receivable</a></span><span class="o">&gt;</span><span class="p">(</span> <span class="c1">// swiftlint:disable:this cyclomatic_complexity</span>
    <span class="n">writeTo</span> <span class="nv">charToWriteTo</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">,</span>
    <span class="nv">value</span><span class="p">:</span> <span class="kt">S</span><span class="p">,</span>
    <span class="n">listenTo</span> <span class="nv">charToListenTo</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">,</span>
    <span class="nv">expectedLength</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span>
    <span class="nv">timeoutInSeconds</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span>
    <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">R</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Enums/ListenAction.html">ListenAction</a></span><span class="p">)</span> <span class="k">throws</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay22SynchronizedPeripheralC23maximumWriteValueLength3forSiSo016CBCharacteristicE4TypeV_tF"></a>
                    <a name="//apple_ref/swift/Method/maximumWriteValueLength(for:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay22SynchronizedPeripheralC23maximumWriteValueLength3forSiSo016CBCharacteristicE4TypeV_tF">maximumWriteValueLength(for:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Ask for the peripheral&rsquo;s maximum payload length in bytes for a single write request.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">maximumWriteValueLength</span><span class="p">(</span><span class="k">for</span> <span class="nv">writeType</span><span class="p">:</span> <span class="kt">CBCharacteristicWriteType</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Int</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay18ConnectionObserverP18bluetoothAvailableyySbF"></a>
                    <a name="//apple_ref/swift/Method/bluetoothAvailable(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay18ConnectionObserverP18bluetoothAvailableyySbF">bluetoothAvailable(_:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">bluetoothAvailable</span><span class="p">(</span><span class="n">_</span> <span class="nv">available</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay18ConnectionObserverP12disconnected4fromyAA20PeripheralIdentifierV_tF"></a>
                    <a name="//apple_ref/swift/Method/disconnected(from:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay18ConnectionObserverP12disconnected4fromyAA20PeripheralIdentifierV_tF">disconnected(from:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">disconnected</span><span class="p">(</span><span class="n">from</span> <span class="nv">peripheral</span><span class="p">:</span> <span class="kt"><a href="../Structs/PeripheralIdentifier.html">PeripheralIdentifier</a></span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </section>
        </section>
        <section id="footer">
          <p>Copyright © 2017 Steamclock Software. All rights reserved.</p>
          <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.5</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
        </section>
      </article>
    </div>
  </body>
</div>
</html>
